export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: '西部招标采购交易平台',
    htmlAttrs: {
      lang: 'zh'
    },
    meta: [{
        charset: 'utf-8'
      },
      {
        name: 'viewport',
        content: 'width=device-width, initial-scale=1'
      },
      {
        hid: 'description',
        name: 'description',
        content: ''
      },
      {
        name: 'format-detection',
        content: 'telephone=no'
      }
    ],
    link: [{
      rel: 'icon',
      type: 'image/x-icon',
      href: '/favicon.ico'
    }]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    'element-ui/lib/theme-chalk/index.css',
    "~/style/index.css"
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/element-ui',
    "~/plugins/route",
    "~/plugins/axios",
    "~/plugins/component"
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy',
    'nuxt-vuex-localstorage'
  ],
  axios: {
    proxy: true,
    // baseURL:'/api',
    prefix: '/rq',
    // // 跨域请求时是否需要使用凭证
    // credentials: true
  },
  proxy: {
    "/rq": {
      "target": "http://huangzhiwen.gnway.cc",
      "changeOrigin": true,
      "pathRewrite": {
        "^/rq": ""
      }
    }
  },
  styleResources: {

  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    transpile: [/^element-ui/],
  },
  router: {
    extendRoutes(routes, resolve) {
      routes.splice(0);
      routes.push({
        name: '首页',
        path: '/',
        component: resolve(__dirname, 'pages/index'),
        children: [

          {
            name: '交易公告',
            path: '/transaction',
            component: resolve(__dirname, 'pages/index/transaction')
          },
          {
            name: "意向公开",
            path: "/intention",
            component: resolve(__dirname, 'pages/index/intention')
          },
          {
            name: "市场调查",
            path: "/market",
            component: resolve(__dirname, 'pages/index/market')
          },
          {
            name: "通知公告",
            path: "/notice",
            component: resolve(__dirname, 'pages/index/notice')
          },
          {
            name: "政策法规",
            path: "/policy",
            component: resolve(__dirname, 'pages/index/policy')
          },
          {
            name: '关于我们',
            path: '/about',
            component: resolve(__dirname, 'pages/index/about')
          },
          {
            name: "注册",
            path: "/register",
            component: resolve(__dirname, "pages/index/register")
          },
          {
            name: "余额明细",
            path: "/personal",
            component: resolve(__dirname, "pages/index/personal")
          },
          {
            name:"我的发布",
            path:"/publish",
            component:resolve(__dirname,"pages/index/publish")
          },
          {
            name:"支付宝支付",
            path:"/applay",
            component:resolve(__dirname,"pages/index/applay")
          },
          {
            name:"新闻详情",
            path:"/detail",
            component:resolve(__dirname,"pages/index/detail")
          }
        ]
      })
    }
  }
}
